//
//  SuspendView.h
//  ICrEAM
//
//  Created by mac on 16/11/1.
//  Copyright © 2016年 mac. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MainViewController.h"

#import "MenuIcon.h"
#import "SubMenu.h"
@class SuspendView;
@interface TopMenuView : UIView{
    CGPoint     _beginPoint;
    CGPoint     _selfBeginCenter;
    NSInteger         _direction;
    
}

@property (nonatomic,weak)SuspendView *selfBoard;
@property (nonatomic,readonly)BOOL moving;
@property (nonatomic,retain)UIImageView *backgroundImageView;

- (int)directByPoint:(CGPoint)point;
@end

@protocol SuspendViewDelegate <NSObject>

-(void)openBoard;
-(void)closeBoard;

@end

extern  NSString *const SuspendViewClickNotification;
@interface SuspendView : UIView{
     NSMutableArray  *_buttonArray;
     BOOL            _running;
    BOOL            _animating;
    CGRect          _boardRect;
}
@property(nonatomic,weak)id<SuspendViewDelegate> delegate;
@property (nonatomic,assign)BOOL  animating;
@property (nonatomic,assign)BOOL  movedWithKeyboard;
//是否正在显示
@property (nonatomic,readonly)BOOL    running;
//按钮的个数
@property (nonatomic,assign)int     buttonNumber;
//是否处于打开状态
@property (nonatomic,readonly)BOOL      isOpen;
@property(nonatomic,strong)NSArray *btns;
@property(nonatomic,strong)SubMenu *menu;
@property(nonatomic,strong)TopMenuView   *boardView;
//是否自动定位到屏幕边缘，默认为YES
@property (nonatomic,assign)BOOL    autoPosition;
//开始显示
- (void)startRunning;

//停止显示
- (void)stopRunning;
- (void)boardClose;
@end

